﻿using System;
using iStudio.Structure.Engine;

namespace iStudio.Loader
{
    public static class Loader
    {
        public static void RegisterGlobals()
        {
            //
            // Add all global settings here
            //

            Manager.Manager.Instance.SettingManager.RegisterSetting ("GLOBAL_WAVEOUT_CHANNELS", 2);
        }

        public static void LoadSystem ()
        {
            Manager.Manager.Instance.PluginManager.LoadPlugins ();

            //
            // Setup first loaded AudioEngine
            //

            if (Manager.Manager.Instance.PluginManager.AudioEngines.Count > 0)
            {
                AudioEngine.SetupEngine(Manager.Manager.Instance.PluginManager.AudioEngines[0]);
            }
            else
            {
                throw new System.IO.FileNotFoundException("No AudioEngine module found.");
            }
        }
    }
}
